<template>
  <iframe
    v-if="appAddr"
    ref="iframe"
    style="width:100%;border:none"
    :style="{ minHeight: `${layoutContentHeight - pageHeaderHeight - layoutFooterHeight + 80}px` }"
    :src="appAddr + '/#/printer?hideLayout=true&actions=' + actions"
  ></iframe>
</template>
<script>
import { layoutMixin } from '@/utils/mixin';
import { getBtnAuth } from '@/utils/util';
import { mapState } from 'vuex';
export default {
  name: 'Printer',
  mixins: [layoutMixin],
  data() {
    return {
      actions: []
    };
  },
  computed: {
    ...mapState({
      appAddr: state => state.helper.appAddr
    })
  },
  created() {
    this.actions = getBtnAuth('printer');
    if (!this.appAddr) {
      this.$store.dispatch('GET_APP_ADDR', { appName: '打印服务' });
    }
  }
};
</script>
